using System;
using System.Text;
using System.Collections.Generic;
using Microsoft.VisualStudio.TestTools.UnitTesting;

using NBear.Common;

namespace NBear.Test.UnitTests
{
    /// <summary>
    /// Summary description for TestMultiInheritence
    /// </summary>
    [TestClass]
    public class TestMultiInheritence
    {
        [Table("AllInOneTable")]
        public interface Parent : IEntity
        {
            [PrimaryKey]
            int ID { get; }
            string Name { get; set; }
        }

        [Table("AllInOneTable")]
        public interface AnotherParent : IEntity
        {
            [PrimaryKey]
            int ID2 { get; }
            int Age { get; set; }
        }

        [Table("AllInOneTable")]
        public interface Child : Parent, AnotherParent
        {
            [PrimaryKey]
            new int ID { get; set; }
            DateTime Birthday { get; set; }
        }

        public TestMultiInheritence()
        {
            //
            // TODO: Add constructor logic here
            //
        }

        #region Additional test attributes
        //
        // You can use the following additional attributes as you write your tests:
        //
        // Use ClassInitialize to run code before running the first test in the class
        // [ClassInitialize()]
        // public static void MyClassInitialize(TestContext testContext) { }
        //
        // Use ClassCleanup to run code after all tests in a class have run
        // [ClassCleanup()]
        // public static void MyClassCleanup() { }
        //
        // Use TestInitialize to run code before running each test 
        // [TestInitialize()]
        // public void MyTestInitialize() { }
        //
        // Use TestCleanup to run code after each test has run
        // [TestCleanup()]
        // public void MyTestCleanup() { }
        //
        #endregion

        [TestMethod]
        public void TestMultiInherit()
        {
            Child obj = EntityFactory<Child>.CreateObject();
            obj.ID = 10;
            obj.Age = obj.ID;
            obj.Birthday = DateTime.Now;
            obj.Name = "teddy";
        }
    }
}
